home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 2: Applications / Linux Cubed Series 2 - Applications.iso / editors / emacs / xemacs / xemacs-1.006 / xemacs-1 / lib / xemacs-19.13 / lisp / oobr / info-brows.el < prev    next >
Encoding:
Text File  |  1995-04-28  |  3.6 KB  |  108 lines

  1. ;;!emacs
  2. ;;
  3. ;; FILE:         info-brows.el
  4. ;; SUMMARY:      Support routines for Info inheritance browsing and error parsing.
  5. ;; USAGE:        GNU Emacs Lisp Library
  6. ;; KEYWORDS:     docs, help, hypermedia
  7. ;;
  8. ;; AUTHOR:       Bob Weiner
  9. ;; ORG:          Motorola Inc.
  10. ;;
  11. ;; ORIG-DATE:     7-Dec-89
  12. ;; LAST-MOD:     26-Apr-95 at 09:50:04 by Bob Weiner
  13. ;;
  14. ;; Copyright (C) 1989-1995  Free Software Foundation, Inc.
  15. ;; See the file BR-COPY for license information.
  16. ;;
  17. ;; This file is part of the OO-Browser.
  18. ;;
  19. ;; DESCRIPTION:  
  20. ;;
  21. ;;    Use 'info-browse' to invoke the Info OO-Browser.  Prefix arg prompts for
  22. ;;    name of Environment file.
  23. ;;
  24. ;; DESCRIP-END.
  25.  
  26. ;;; ************************************************************************
  27. ;;; Other required Elisp libraries
  28. ;;; ************************************************************************
  29.  
  30. (mapcar 'require '(info br-start br br-info))
  31.  
  32. ;;; ************************************************************************
  33. ;;; Public functions
  34. ;;; ************************************************************************
  35.  
  36. ;;;###autoload
  37. (defun info-browse (&optional env-file no-ui)
  38.   "Invoke the Info OO-Browser.
  39. This allows browsing through Info library and system class hierarchies.  With
  40. an optional non-nil prefix argument ENV-FILE, prompt for Environment file to
  41. use.  Alternatively, a string value of ENV-FILE is used as the Environment
  42. file name.  See also the file \"br-help\"."
  43.   (interactive "P")
  44.   (let ((same-lang (equal br-lang-prefix info-lang-prefix)))
  45.     (if same-lang
  46.     nil
  47.       (if br-lang-prefix
  48.       (br-env-copy nil)) ;; Save other language Environment in memory
  49.       (setq br-lang-prefix info-lang-prefix
  50.         *br-save-wconfig* nil))
  51.     (let ((same-env (or (equal info-env-file env-file)
  52.             (and (null env-file)
  53.                  (or info-lib-search-dirs info-sys-search-dirs)))))
  54.       (cond
  55.       ;; Continue browsing an Environment
  56.     ((and same-env same-lang))
  57.     ((and same-env (not same-lang))
  58.      (progn (info-browse-setup) (br-env-copy t)))
  59.     ;;
  60.     ;; Create default Environment file specification if needed and none
  61.     ;; exists.
  62.     ;;
  63.     (t (progn (or env-file (file-exists-p info-env-file)
  64.               (br-env-create info-env-file info-lang-prefix))
  65.           (or env-file (setq env-file info-env-file))
  66.           ;;
  67.           ;; Start browsing a new Environment.
  68.           ;;
  69.           (info-browse-setup)
  70.           (setq *br-save-wconfig* nil
  71.             info-env-file (br-env-init env-file same-lang nil)
  72.             info-sys-search-dirs br-sys-search-dirs
  73.             info-lib-search-dirs br-lib-search-dirs))))))
  74.   (or no-ui (br-browse)))
  75.  
  76. ;; Don't filter Environment classes when listed.
  77. (fset 'info-class-list-filter 'identity)
  78.  
  79. (defun info-class-definition-regexp (class)
  80.   "Return regexp to uniquely match the definition of CLASS name."
  81.   (concat info-class-name-before (regexp-quote class)
  82.       info-class-name-after))
  83.  
  84. ;;; ************************************************************************
  85. ;;; Internal functions
  86. ;;; ************************************************************************
  87.  
  88. (defun info-find-nd-name ()
  89.   (let ((end))
  90.     (save-excursion
  91.       (skip-chars-forward info-identifier-chars)
  92.       (setq end (point))
  93.       (skip-chars-backward info-identifier-chars)
  94.       (skip-chars-forward " \n")
  95.       (buffer-substring (point) end))))
  96.  
  97. (defun info-browse-setup ()
  98.   "Setup language-dependent functions for OO-Browser."
  99.   (br-setup-functions)
  100.   ;; Use this until an info function is implemented for the language.
  101.   (fmakunbound 'br-insert-class-info)
  102.   (fset 'br-store-class-info 'info-store-class-info)
  103.   (fset 'br-lang-mode 'Info-mode)
  104.   (fset 'br-find-class-name 'info-find-nd-name)
  105.   (br-setup-constants))
  106.  
  107. (provide 'info-browse)
  108.